//
//  SetUpImageCell.m
//  cityStar
//
//  Created by joyban on 15-2-11.
//  Copyright (c) 2015年 tiny. All rights reserved.
//

#import "SetUpImageCell.h"

@implementation SetUpImageCell

+(CGFloat)heightOfTableCell
{
    return 220;
}

- (void)awakeFromNib {
    // Initialization code
    self.fieldIntroduction.delegate = self;
    self.fieldIntroduction.placeholder = @"输入内容";
    self.fieldIntroduction.placeholderColor = [UIColor colorWithWhite:0.797 alpha:1.000];
}

#pragma mark - Actions
-(IBAction)publishButton_Touch:(id)sender
{
    if ([self.delegate respondsToSelector:@selector(setUpImageCellPublishButton)]) {
        [self.delegate setUpImageCellPublishButton];
    }
}

-(IBAction)uploadImage_Touch:(UIButton *)sender
{
//    if ([self.delegate respondsToSelector:@selector(uploadImage_Touch:)]) {
        [self.delegate upLoadImageWithButtonTag:sender.tag];
//    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(void)textViewDidBeginEditing:(UITextView *)textView
{
    textView.text = @"";
    textView.textColor = [UIColor colorWithWhite:0.151 alpha:1.000];
}

-(BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text
{
    if ([text isEqualToString:@"\n"]) {
        [textView resignFirstResponder];
        return NO;
    }
    return YES;
}

-(BOOL)textFieldShouldReturn:(UITextField *)textField
{
    [textField resignFirstResponder];
    return YES;
}

@end
